package src.ee.ioc.smaug.world;

import java.util.Random;

/**
 * Working with random booleans
 * @author Margarita Spichakova
 *
 */
public class Coin {

    /**
     * Creating random boolean value
     * @return random boolean
     */
    public static boolean flipCoin(){
         Random rnd = new Random();
         if (rnd.nextDouble()<0.5){
             return false;
         }else return true;
 
    }
    /**
     * Transforms boolean to integer
     * @param print boolean
     * @return corresponding integer
     */
    public static int booleanToInteger(boolean print) {
        if (print) {
            return 1;
        } else {
            return 0;
        }
    }

    

}